package service;

import model.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.Scanner;

public class RentalSystem {
    private List<Car> cars;
    private List<Customer> customers;
    private List<RentalOrder> orders;
    private Scanner scanner;
    private DeliveryService deliveryService;
    private Random random = new Random();

    public RentalSystem() {
        cars = new ArrayList<>();
        customers = new ArrayList<>();
        orders = new ArrayList<>();
        scanner = new Scanner(System.in);
        deliveryService = new DeliveryService();
        initData();
    }

    private void initData() {
        // 修正车辆构造函数参数顺序，匹配Car类的构造函数
        cars.add(new Sedan("鄂B12345", "大众帕萨特", 299, false, false, 5,"B"));
        cars.add(new Sedan("鄂BD66666", "小米su7ultra", 999, true,false, 5,"C"));
        cars.add(new SUV("鄂B54321", "奔驰GLC", 599, false ,false, false));
        cars.add(new SUV("鄂BD11111", "特斯拉Model Y", 499, true,false, true));

        customers.add(new Customer("C001", "张三", false));
        customers.add(new Customer("C002", "李四", true));
    }

    public void showMenu() {
        System.out.println("\n=== 汽车租赁系统 ===");
        System.out.println("1. 查看所有车辆");
        System.out.println("2. 查看所有客户");
        System.out.println("3. 添加客户");
        System.out.println("4. 租赁车辆（生成订单）");
        System.out.println("5. 归还车辆（更新订单）");
        System.out.println("6. 查看所有订单");
        System.out.println("7. 退出系统");
        System.out.print("请选择操作(1-7): ");
    }
}